/*
Jack Morris
11/20/14
Chapter 6
Page 122
Assinment 2
*/
#include<stdio.h>

int main()
{
int x,y,m,i;

  printf("Enter two integers :");

  scanf("%d%d",&x,&y);
  if(x > y)
  {
    m=y;
  }
  else
  {
    m=x;
  }
  for(i=m;i>=1;i--)
  {
    if(x%i==0&&y%i==0)
    {
      printf("Greatest common divisor: %d",i) ;
      break;
    }
  }
  return( 0 );
}